package com.demo.dao.imp;

import java.util.List;

import org.apache.log4j.Logger;

import com.demo.dao.UserDao;
import com.demo.entity.Userinfo;
import com.demo.otherbeans.PagesBean;

public class UserDaoImpl extends HibernateBaseDaoImpl implements UserDao{
	
	public UserDaoImpl(){
		super();
	}
	
	
	
	private static Logger log = Logger.getLogger(UserDaoImpl.class);

	
	public PagesBean findUserPageByHql(String hql,int currentPage ,int pageSize ){
		int rowCount = this.getCountByHql(hql);
		return this.getPageByHql(hql, currentPage, pageSize,rowCount);
	}
	
	public PagesBean findUserPageBySql(String sql,int currentPage ,int pageSize ){
		int rowCount = this.getCountBySql(sql);
		return this.getPageBySql(sql, currentPage, pageSize,rowCount);
	}
	
	public List<Userinfo> findUser(String hql) {
		return this.findByHql(hql);
	}

	public void saveUser(Userinfo userinfo) { 
		this.saveEntity(userinfo); 
	} 
	

}
